package com.taoym.voucher.common.enums;

import lombok.Getter;

/**
 * @coder taoym
 * @datetime 2021/8/30 11:11
 * @desc
 */
@Getter
public enum OrderBuyTypeEnum implements EnumsCommon {

    MYSELF(1, "自购"),
    TEAM(2, "队员"),
    ;

    private final Integer code;
    private final String msg;

    OrderBuyTypeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static OrderBuyTypeEnum getInstance(Integer code) {
        for (OrderBuyTypeEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
